cmake_minimum_required (VERSION 3.10.0)

project (android_manager VERSION 1.0 LANGUAGES CXX)

set (TARGET_NAME android_manager)

set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
set (QT_MINIMUM_VERSION "5.10")

include (GNUInstallDirs)

find_package (Qt5 REQUIRED COMPONENTS Core Widgets Gui)
find_package (Dtk COMPONENTS Widget REQUIRED)

add_executable (${TARGET_NAME})

target_sources(${TARGET_NAME}
PRIVATE
    main.cpp
    baseInfoWidget.cpp
    contentWidget.cpp
    sucessconnectwidget.cpp
    failcontentwidget.cpp
    installappwidget.cpp
    mainwindow.cpp
    installapkthread.cpp
    installwaitdialog.cpp

    baseInfoWidget.h
    contentWidget.h
    sucessconnectwidget.h
    failcontentwidget.h
    installappwidget.h
    mainwindow.h
    installapkthread.h
    installwaitdialog.h
)

target_include_directories(${TARGET_NAME}
PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_link_libraries (${TARGET_NAME} Qt5::Widgets dtkcore dtkwidget)

# Install / DISTFILES

install (
    TARGETS ${TARGET_NAME}
    DESTINATION ${CMAKE_INSTALL_BINDIR}
)

# CPACK: General Settings
set (CPACK_GENERATOR "TBZ2")
set (CPACK_PACKAGE_NAME "dtk-android-manager")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A simple Android manager")
set (CPACK_PACKAGE_VENDOR "FLanWu")
set (CPACK_PACKAGE_CONTACT "https://gitee.com/hcflyambation/dtk_android_manager")
if (WIN32)
    # ...
elseif (APPLE)
    # ...
elseif (UNIX)
    set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
    set (CPACK_DEBIAN_PACKAGE_SHILIBDEPS ON)
    set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "adb")
endif()

include(CPack)
